package com.vfconsulting.common.action;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.TreeMap;

import com.opensymphony.xwork2.ActionSupport;
import com.vfconsulting.util.ListValue;

public class ChartBarAction extends ActionSupport {

	private static final long serialVersionUID = 1L;
	
	  private List<ListValue>     objList;
	  private Map<Double, Double> doubleMap;

	  public String execute()
	  {

	    objList = new ArrayList<ListValue>();
	    doubleMap = new TreeMap<Double, Double>();

	    Random generator = new Random();
	    for (int i = 1; i <= 24; i++)
	    {
	      doubleMap.put(Double.valueOf("" + i), generator.nextDouble() * 10.0);
	    }

	    for (int i = 1; i <= 24; i++)
	    {
	      objList.add(new ListValue("" + i, "" + generator.nextInt(30)));
	    }

	    return SUCCESS;
	  }

	public List<ListValue> getObjList() {
		return objList;
	}

	public void setObjList(List<ListValue> objList) {
		this.objList = objList;
	}

	public Map<Double, Double> getDoubleMap() {
		return doubleMap;
	}

	public void setDoubleMap(Map<Double, Double> doubleMap) {
		this.doubleMap = doubleMap;
	}
	  
	  


}
